Instruction Manual for Bookstore Management System

1. Prerequisites
Ensure you have Node.js installed on your system.
Install an IDE like Visual Studio Code for editing and running the code.
Use a modern browser (e.g., Chrome, Edge) for accessing the application.

2. Setting Up the Project
Clone or download the project files into a folder on your local machine.
Open a terminal and navigate to the project folder.

3. Installing Dependencies
Install the required dependencies for the backend:
bash
Copy code
npm install express cors

4. Running the Server
Navigate to the project folder containing server.js.
Start the server using:
bash
Copy code
node server.js
Once the server is running, it will display:
arduino
Copy code
Server is running on http://localhost:3000

5. Accessing the Application
Open index.html in a browser:
Right-click the file and select Open with Browser (or drag it into the browser).
The webpage will display the Bookstore Management System.

6. Application Features
View All Books:
The main table displays a list of books fetched from the backend.
Add a New Book:
Fill out the form in the "Add a New Book" section and click Add Book.
The new book will be added and appear in the table.
View Book Details:
Click View Details next to any book in the table to see its details in a popup.
Update a Book:
In the "Edit Book" section, input the book details and click Update Book.
The book's information will be updated in the table.
Delete a Book:
Click Delete next to a book in the table to remove it.
The book will be deleted from the table and backend.

7. Backend Endpoints
Endpoint	Method	Description
/books	GET	Fetch all books.
/books/:id	GET	Fetch a single book by its ID.
/books	POST	Add a new book.
/books/:id	PUT	Update a book by its ID.
/books/:id	DELETE	Delete a book by its ID.

8. Modifying the Code
Frontend (index.html & script.js):
Customize the layout or add new UI features.
Backend (server.js):
Add new endpoints or modify existing ones to extend functionality.

9. Troubleshooting
Cannot connect to the server:
Ensure the server is running on http://localhost:3000.
Changes not reflected:
Refresh the page and check the browser console for errors.
Backend errors:
Check the terminal for error logs.